package com.sys.controller;

import com.sys.entity.Dictionary;
import com.sys.service.DictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

/**
 * Created by dell on 2016/9/21.
 */
@RestController
public class DictionaryController {

    @Autowired
    private DictionaryService dictionaryService;

    @RequestMapping(value = "dic",method = RequestMethod.GET)
    public List<Dictionary> get(String name){
       return dictionaryService.findByName(name);
    }

    @RequestMapping(value = "dicm",method = RequestMethod.GET)
    public List<Dictionary> getm(){
        return dictionaryService.search(new HashMap<>());
    }
}
